import { Commit } from 'vuex';
import { StartDate } from '../hooks/useStartDate';
import { ProjectConfig } from './config';

export interface UserInfo {
  nickname: string;
  headimgurl: string;
  openid: string;
  city: string;
  country: string;
  id: string;
  province: string;
  sex: number;
}

export interface ResultData {
  token: string;
  user: UserInfo;
}

export interface State {
  loginStatus: number;
  accessToken: string | undefined;
  userInfo: UserInfo;
  code: string;
  projectSetting: ProjectConfig;
  scopeNumber: number;
  startDate: Partial<StartDate>;
  intention: Partial<IntentionData>;
  myIntention: string;
}

export type PompeiType = 'petition' | 'grace';

export interface PompeiLang {
  PompeiType: string;
}

export interface CommitFunction {
  commit: Commit;
}

export interface CommitStateFunction extends CommitFunction {
  state: State;
}

export interface AppTab {
  title: string;
  url: string;
}

export interface IntentionParams {
  uuid: string;
}

export interface IntentionData {
  id: number;
  uuid: string;
  create_date: Date;
  description: string;
  group_qrc: string;
  intention: string;
  intention_status: number;
  number_participant: number;
  short_intention: string;
  start_date: string;
  status: boolean;
  update_date: Date;
  user: UserInfo;
  weixin_id: string;
  isJoin: boolean;
}
